#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
int main() {
	int N, i, letter, blank, digit, other;
	char ch1;

	letter = blank = digit = other = 0;
	scanf("%d", &N);
	getchar();
	for (i = 0; i < N; i++) {
		ch1 = getchar();
		if ((ch1 >= 'a') && (ch1 <= 'z') || (ch1 >= 'A') && (ch1 <= 'Z'))
			letter += 1;
		else if (ch1 == ' ' || ch1 == '\n')
			blank += 1;
		else if ((ch1 >= '0') && (ch1 <= '9'))
			digit += 1;
		else
			other += 1;
	}

	printf("letter = %d, blank = %d, digit = %d, other = %d", letter, blank, digit, other);
	return 0;
}